/*************************************************************************
	> File Name: mpuangle.h
	> Author: xxx
	> Mail: xxx
	> Created Time: 2022年04月06日 星期三 23时33分05秒
 ************************************************************************/
#include <hardware/bearpi.h>
#include <hardware/hardware.h>
#include <asm/ioctl.h>
#include "eMPL/inv_mpu.h"
#include "eMPL/inv_mpu_dmp_motion_driver.h"
#include "mpu_register.h"
#include "notify_msg.h"

#define IOC_MAGIC  'c'
#define IOCINIT    _IO(IOC_MAGIC, 0)
#define IOCSETREGCMD    _IOWR(IOC_MAGIC, 1, unsigned char)
#define SLEEP     _IO(IOC_MAGIC, 2)
#define WAKEUP    _IO(IOC_MAGIC, 3)
#define TIMEOUT_WAKELOCK    _IO(IOC_MAGIC, 4)
#define LED_ON    _IO(IOC_MAGIC, 5)
#define LED_OFF    _IO(IOC_MAGIC, 6)


void start_process(void);
void stop_process(void);

u8 MPU_Init(void);
u8 MPU_Write_Byte(u8 reg,u8 data);
u8 MPU_Read_Byte(u8 reg);
u8 MPU_Write_Len(u8 addr,u8 reg,u8 len,u8 *buf);
u8 MPU_Read_Len(u8 addr,u8 reg,u8 len,u8 *buf);

u8 MPU_Set_Gyro_Fsr(u8 fsr);
u8 MPU_Set_Accel_Fsr(u8 fsr);
u8 MPU_Set_LPF(u16 lpf);
u8 MPU_Set_Rate(u16 rate);
u8 MPU_Set_Fifo(u8 sens);



